<!--
 * @Author: ChunLai
 * @Date: 2022-01-17 13:40:41
 * @LastEditTime: 2025-08-29 13:52:00
 * @Description: 保单信息 
 * @FilePath: \02.bldinsure\src\views\sign\components\infos\BillInfos.vue
-->
<template>
  <div class="customer_infos">
    <div class="notice-mode-head">
      <span class="head-box">保单相关信息</span>
    </div>
    <ul class="list_ul_box">
      <van-cell
        v-if="payApiReg.effectiveDate !== void 0"
        title="生效日期："
        :value="payInfo.effectiveDate"
      />
      <van-cell
        v-if="payApiReg.expiryDate !== void 0"
        title="截止日期："
        :value="payInfo.expiryDate"
      />
      <van-cell v-if="payApiReg.printPolType !== void 0" title="保单类型：">
        {{ billType(payInfo.printPolType) }}
      </van-cell>
      <van-cell
        v-if="payApiReg.qsContSelfFlag !== void 0"
        title="是否为自保件："
      >
        {{ payInfo.qsContSelfFlag == "1" ? "是" : "否" }}
      </van-cell>
      <van-cell v-if="payApiReg.hospitalCode !== void 0" title="合作医院：">
        {{ payInfo.hospitalCodeName }}
      </van-cell>
      <van-cell v-if="payApiReg.payMode !== void 0" title="缴费方式：">
        {{ payInfo.payMode === "R" ? "实时代扣" : "批次代扣" }}
      </van-cell>
      <van-cell
        v-if="payApiReg.bankAccName !== void 0"
        title="账户姓名："
        :value="payInfo.bankAccName"
      />
      <van-cell
        v-if="payApiReg.bankName !== void 0"
        title="银行名称："
        :value="payInfo.bankName"
      />
      <van-cell v-if="payApiReg.bankAccNo !== void 0" title="银行账号：">
        {{ countNum }}
      </van-cell>
      <van-cell
        v-if="payApiReg.rgtAddress !== void 0"
        title="开户行所在地："
        :value="payInfo.rgtAddress"
      />
      <van-cell
        v-if="payApiReg.firBankMobile !== void 0"
        title="银行预留手机号："
        :value="payInfo.firBankMobile"
      />
    </ul>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  name: "BillInfos",
  data() {
    return {};
  },
  computed: {
    ...mapGetters({
      payApiReg: "infoReg/payApiReg",
      payInfo: "insert/payInfo",
      contractTypeList: "dictionary/contractTypeList",
    }),
    countNum() {
      return this.payInfo.bankAccNo.replace(/(\d{4})(?=\d)/g, "$1 ");
    },
    billType(val) {
      return function (val) {
        let obj = this.contractTypeList.find((ele) => ele.value === val);
        return (obj && obj.label) || "";
      };
    },
    countNum() {
      return this.payInfo.bankAccNo.replace(/(\d{4})(?=\d)/g, "$1 ");
    },
  },
  created() {},
  methods: {},
};
</script>

<style lang="less" scoped>
@import "./style.less";
</style>
